package com.weiyuwqj.api.constant;

/**
 * Created by Administrator on 2017/2/23.
 */
public enum RepaymentType {

    DAY(1),             //天
    MONTH(2),           //月
    SEASON(3),          //季
    YEAR(4);            //年

    private int value =1;

    private RepaymentType(int value){
        this.value = value;
    }

    public static RepaymentType valueOf(int value) {    //    手写的从int到enum的转换函数
        switch (value) {
            case 1:
                return DAY;
            case 2:
                return MONTH;
            case 3:
                return SEASON;
            case 4:
                return YEAR;
            default:
                return null;
        }
    }

    public int value() {
        return this.value;
    }
}
